package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.entity.OrderDetailet;
import java.util.List;

public interface IOrderDetailetMapper {
    // 插入订单明细记录
    @Insert("INSERT INTO order_detailet (order_id, food_id, quantity) VALUES (#{orderId}, #{foodId}, #{quantity})")
    int insert(OrderDetailet orderDetailet);

    // 根据订单ID查询所有订单明细
    @Select("SELECT * FROM order_detailet WHERE order_id = #{orderId}")
    List<OrderDetailet> selectByOrderId(@Param("orderId") Integer orderId);
} 